﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Warhammer40K_Simulator.model
{
    public class unit : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }

        public unit()
        {
            Figures = new ObservableCollection<figure>();
        }

        public unit clone()
        {
            unit u = new unit();
            u.copy(this);         
            return u;
        }

        public void copy(unit u)
        {
            Name = u.Name;
            TroopType = u.TroopType;
            UnitType = u.UnitType;
            Cost = u.Cost;
            Figures = new ObservableCollection<figure>();

            foreach (figure f in u.Figures)
            {
                Figures.Add(f.clone());
            }

        }



        public String Name { get; set; }
        public String TroopType { get; set; }
        public String UnitType { get; set; }
        public int Cost { get; set; }
        public ObservableCollection<figure> Figures { get; set; }

    }
}
